package br.com.honorato.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class LogUtil
{
	private static Logger logger = null;

	static
	{
		logger = LogManager.getLogger(LogUtil.class.getName());
	}

	public static void info(Class<?> classe, String msg)
	{
		logger = LogManager.getLogger(classe.getName());
		logger.info(msg);
	}

	public static void debug(Class<?> classe, String msg)
	{
		logger = LogManager.getLogger(classe.getName());
		logger.debug(msg);
	}

	public static void error(Class<?> classe, String msg, Exception exception)
	{
		logger = LogManager.getLogger(classe.getName());
		logger.error(msg);
		logger.error(exception, exception.getCause());
	}

	public static Logger getLogger()
	{
		return logger;
	}
}